package io.github.qifan777.server.config;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RequestMapping("config")
@AllArgsConstructor
@RestController
@Slf4j
public class ConfigController {
    private final ConfigRepository configRepository;

    @GetMapping
    public Config find() {
        return configRepository.find();
    }

    @PostMapping
    public void save(@RequestBody Config config) {
        configRepository.save(config);
    }
}
